package com.itheima.controller;

import com.itheima.Log.Log;
import com.itheima.common.R;
import com.itheima.utils.AliOSSUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
public class uploadController {
    @Autowired
    AliOSSUtils aliOSSUtils;
    @PostMapping("/upload")
    public R file(MultipartFile file) throws IOException {
        String upload = aliOSSUtils.upload(file);
        return R.ok(upload);
    }

}
